
<%@include file="/WebPages/Includes/header.jsp"%>
<%@include file="/WebPages/Includes/startBody.jsp"%>
<%@include file="/WebPages/Includes/tablesorter.jsp"%>
<%@include file="/WebPages/Includes/navbar.jsp"%>
<%@include file="/WebPages/Includes/startMainContent.jsp"%>
<%@include file="/WebPages/Includes/leftSidebar.jsp"%>

<div class="col-lg-8 col-md-8 col-xs-12 col-sm-9">
	<hr>

	<button class="btn btn-primary btn-lg" data-target="#myInsertModal"
		data-toggle="modal">Create Master Section</button>

	<button class="btn btn-danger btn-lg" data-target="#myConfirmModal"
		data-toggle="modal" id="deleteSelectedRows">Delete Selected</button>

	<hr>

	<div class="table-responsive"
		style="overflow-x: auto; overflow-y: auto;" id="tableDiv"></div>

	<!-- Insert Modal -->
	<div aria-hidden="true" aria-labelledby="myInsertModalLabel"
		class="modal fade" id="myInsertModal" role="dialog" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button aria-hidden="true" class="close" data-dismiss="modal"
						type="button">&times;</button>
					<h4 class="modal-title" id="myInsertModalLabel">Create Master
						Section</h4>
				</div>
				<div class="modal-body">
					<!-- 					<form id="insertForm" method="post" name="insertForm" role="form"> -->

					<!-- 						<div class="modal-footer"> -->
					<!-- 							<button class="btn btn-default" data-dismiss="modal" -->
					<!-- 								type="button">Close</button> -->
					<!-- 							<button class="btn btn-primary" id="insertMasterSection" -->
					<!-- 								type="button">Create Master Section</button> -->
					<!-- 						</div> -->
					<!-- 					</form> -->
					<form id="addGroupForm" method="post">
						<div class="form-group">
							<label class="control-label" for="groupName">Group Name</label> <input
								class="form-control" id="groupName" name="groupName"
								placeholder="Group Name" type="text" />
						</div>
						<div class="form-group">
							<label class="control-label" for="description">Group
								Description</label> <input class="form-control" id="description"
								name="description" placeholder="Group Description" type="text" />
						</div>

						<table id="defaultGroupsTable">
							<tr>
								<th>Select</th>
								<th>Name</th>
								<th>Description</th>
							</tr>
						</table>
						<button class="btn btn-primary" id="request"
							onclick="saveCustomGroup();" type="button">Request</button>
					</form>
				</div>
			</div>
		</div>
	</div>


	<!-- Update Modal -->
	<div aria-hidden="true" aria-labelledby="myModalLabel"
		class="modal fade" id="myUpdateModal" role="dialog" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button aria-hidden="true" class="close" data-dismiss="modal"
						type="button">&times;</button>
					<h4 class="modal-title" id="myModalLabel">Update Master
						Section</h4>
				</div>
				<div class="modal-body">

					<form id="updateForm" method="post">
						<div class="form-group">
							<label class="control-label" for="groupName">Group Name</label> <input
								class="form-control" id="ugroupName" name="ugroupName"
								placeholder="Group Name" type="text" />
						</div>
						<div class="form-group">
							<label class="control-label" for="description">Group
								Description</label> <input class="form-control" id="udescription"
								name="udescription" placeholder="Group Description" type="text" />
						</div>
<input   id="ucode" 		name="ucode" placeholder="Group Description" type="hidden" />
						<table id="defaultGroupsTableUpdate">
							<tr>
								<th>Select</th>
								<th>Name</th>
								<th>Description</th>
							</tr>
						</table>
						<button class="btn btn-primary" id="update"
							onclick="updateCustomGroup();" type="button">Update</button>
					</form>
				</div>
			</div>
		</div>
	</div>


	<!-- Confirm Modal -->
	<div aria-hidden="true" aria-labelledby="myConfirmModalLabel"
		class="modal fade" id="myConfirmModal" role="dialog" tabindex="-1">
		<div class="modal-dialog">
			<div align="center" class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" id="myConfirmModalLabel">Are you sure?</h4>
				</div>
				<div class="modal-body">
					<button class="btn btn-danger" id="confirmDelete" type="submit">Yes</button>
					<button class="btn btn-primary" id="cancelDelete" type="submit">No</button>
				</div>
			</div>
		</div>
	</div>

	<!-- Error modal -->
	<div class="modal fade bs-example-modal-sm" id="myErrorModal"
		tabindex="-1" role="dialog" aria-labelledby="myErrorModalLabel"
		aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content" align="center">
				<div class="modal-header">
					<h4 class="modal-title" id="myErrorModalLabel">Error</h4>
				</div>
				<div class="modal-body">
					<div id="ErrorContent"></div>
					<hr />
					<button class="btn btn-primary" id="errorOk" type="submit">Ok</button>
				</div>
			</div>
		</div>
	</div>
</div>

<%@include file="/WebPages/Includes/rightSidebar.jsp"%>
<%@include file="/WebPages/Includes/endMainContent.jsp"%>
<%@include file="/WebPages/Includes/footer.jsp"%>

<!-- custom scripts here -->
<script src="./../../customJS/Identity/IdentityGroup.js"></script>

<%@include file="/WebPages/Includes/endBody.jsp"%>